/**
 * @Author: 陈瑞鹏
 * @Date:   2022-10-14 18:20:23
 * @Last Modified by:   陈瑞鹏
 * @Last Modified time: 2022-10-15 10:01:44
 */
//大数字运算
import bigDecimal from "js-big-decimal";

export default class bigNumber {

  constructor() { };

  /**
   * 加法
   * @param num1 
   * @param num2 
   * @returns 
   */
  static jia(num1: number | string, num2: number | string): string {
    return bigDecimal.add(num1, num2);
  }

  /**
   * 减法
   * @param num1 
   * @param num2 
   * @returns 
   */
  static jian(num1: number | string, num2: number | string): string {
    return bigDecimal.subtract(num1, num2);
  }

  /**
   * 乘法
   * @param num1 
   * @param num2 
   * @returns 
   */
  static cheng(num1: number | string, num2: number | string): string {
    return bigDecimal.multiply(num1, num2);
  }

  static chu(num1: number | string, num2: number | string, precission: number = 0): string {
    return bigDecimal.divide(num1, num2, precission);
  }
}